<?php 
global $_GPC, $_W;
$shopid=check_right(2);
if(!$shopid)message("请先选择需要管理的店铺",$this->createWebUrl('shop'),'error');
$shop=pdo_fetch("SELECT * FROM ".tablename('j_hmoney_group')." WHERE weid = '{$_W['uniacid']}' and id='".$shopid."'");
$operation = !empty($_GPC['op']) ? $_GPC['op'] : 'display';
$cfg = $this->module['config'];

if($operation=="display" || $operation=="charge"){
	
} elseif ($operation == 'getinfo') {
	$condition = " and groupid ='".$shopid."' ";
	switch(intval($_GPC['datetype'])){
		case "1":
			$condition .= " and createdate='".date('Y-m-d')."' ";
		break;
		case "2":
			$condition .= " and createdate='".date('Y-m-d',strtotime("-1 day"))."' ";
		break;
		case "3":
			$condition .= " and createdate>='".date('Y-m-d',strtotime("-6 day"))."' ";
		break;
		case "4":
			$condition .= " and createtime>='".strtotime($_GPC['statrtime'])."' and createtime<='".strtotime($_GPC['endtime'])."' ";
		break;
	}
	if(isset($_GPC['paytype']))$condition .= " and paytype = '" . $_GPC['paytype'] . "' ";
	$notmember = pdo_fetch("SELECT count(*) as num1,sum(total_fee) as fee1,sum(num) as num2 FROM ".tablename('j_hmoney_order')." WHERE weid='{$_W['uniacid']}' $condition and memberno=0 and ispay=1");
	$member = pdo_fetch("SELECT count(*) as num1,sum(total_fee) as fee1,sum(num) as num2 FROM ".tablename('j_hmoney_order')." WHERE weid='{$_W['uniacid']}' $condition and memberno>0 and ispay=1");
	
	die(json_encode(array("success"=>true,"notmember"=>$notmember,"member"=>$member)));
	
}
include $this->template('web/'.$cfg['floder'].'/salemember');